import request from '@/utils/request';

/**
 * 分页获取观看历史 且顺序从新到旧
*/
export function getHistoryListApi(params) {
  return request({
    url: '/video-history/history',
    method: 'get',
    params
  });
}

/**
 * 新增观看历史
*/
export function createHistoryApi(videoId) {
  return request({
    url: `/video-history/${videoId}`,
    method: 'post',
  });
}

/**
 * 删除观看历史
*/
export function deleteHistoryApi(historyId) {
  return request({
    url: `/video-history/clearById/${historyId}`,
    method: 'delete'
  });
}

/**
 * 清空观看历史
*/
export function clearHistoryApi() {
  return request({
    url: '/video-history/clear',
    method: 'delete'
  });
}


